#include "throw_exception_behavior.hpp"
#include "exception_thrower.hpp"
#include "config.hpp"

namespace vimock {
throw_exception_behavior::throw_exception_behavior(
		invocation_matcher inv_matcher, exception_thrower ex_to_throw) :
	inv_matcher(inv_matcher), ex_to_throw(ex_to_throw) {
}
throw_exception_behavior::~throw_exception_behavior() {

}
object throw_exception_behavior::replay(invocation inv) {
	if (inv_matcher->matches(inv)) {
		ex_to_throw.throw_exception();
	}
	config::selected_error_reporter->report_unexpected_invocation();
	return 0;
}
}
